import { NIcon } from "naive-ui";
import { Component, h } from "vue";
import {
  BookOutline as BookIcon,
  PersonOutline as PersonIcon,
  WineOutline as WineIcon,
} from "@vicons/ionicons5";
import { RouterLink } from "vue-router";

function renderIcon(icon: Component) {
  return () => h(NIcon, null, { default: () => h(icon) });
}
export const menuOptions = [
  {
    label: "数据采集",
    key: "data-collection",
    icon: renderIcon(BookIcon),
    children: [
      {
        label: () =>
          h(
            RouterLink,
            {
              to: {
                path: "/personal-change",
              },
            },
            { default: () => "人员变更" }
          ),
      },
    ],
  },
  {
    label: "元管理",
    key: "meta-management",
    icon: renderIcon(BookIcon),
    children: [
      {
        key: "data-source-management",
        label: () =>
          h(
            RouterLink,
            {
              to: {
                path: "/data-sources",
              },
            },
            { default: () => "数据源管理" }
          ),
      },
    ],
  },
  {
    label: "数据质量管理",
    key: "data-quality-management",
    icon: renderIcon(BookIcon),
    children: [
      {
        key: "rule-management",
        label: () =>
          h(
            RouterLink,
            {
              to: {
                path: "/home",
              },
            },
            { default: () => "规则管理" }
          ),
      },
      {
        key: "hQualityschemeTableVue",
        label: () =>
          h(
            RouterLink,
            {
              to: {
                path: "/quality-scheme",
              },
            },
            { default: () => "质量方案" }
          ),
      },
      {
        key: "hQualityTetectionTableVue",
        label: () =>
          h(
            RouterLink,
            {
              to: {
                path: "/quality-tetection",
              },
            },
            { default: () => "质量检查" }
          ),
      },
      {
        key: "hJobManagementTableVue",
        label: () =>
          h(
            RouterLink,
            {
              to: {
                path: "/job-management",
              },
            },
            { default: () => "工作管理" }
          ),
      },
    ],
  },
  {
    label: "业务源数据管理",
    key: "business-source-data-management",
    icon: renderIcon(PersonIcon),
    children: [
      {
        type: "group",
        label: "管理员",
        key: "admin",
      },
      {
        type: "group",
        label: "用户",
        key: "user",
      },
    ],
  },
];
